/*
Navicat MySQL Data Transfer

Source Server         : localhost
Source Server Version : 50519
Source Host           : localhost:3306
Source Database       : mypro

Target Server Type    : MYSQL
Target Server Version : 50519
File Encoding         : 65001

Date: 2012-06-08 00:35:59
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `acc_permission`
-- ----------------------------
DROP TABLE IF EXISTS `acc_permission`;
CREATE TABLE `acc_permission` (
  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `PARENT` bigint(20) DEFAULT NULL,
  `TYPE` varchar(1) NOT NULL,
  `NAME` varchar(20) NOT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`),
  KEY `FKED6BF84D9298D268` (`PARENT`),
  CONSTRAINT `FKED6BF84D9298D268` FOREIGN KEY (`PARENT`) REFERENCES `acc_permission` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of acc_permission
-- ----------------------------
INSERT INTO `acc_permission` VALUES ('1', null, 'D', '用户管理', '1', '2012-03-29 11:51:51', '1', '2012-03-28 11:51:55');
INSERT INTO `acc_permission` VALUES ('2', '1', 'C', '新增用户', '1', '2012-03-21 11:52:14', '1', '2012-03-25 11:52:17');
INSERT INTO `acc_permission` VALUES ('3', '1', 'C', '修改用户', '1', '2012-03-25 11:52:31', '1', '2012-03-25 11:52:34');
INSERT INTO `acc_permission` VALUES ('4', '1', 'C', '删除用户', '1', '2012-03-25 11:52:50', '1', '2012-03-25 11:52:53');
INSERT INTO `acc_permission` VALUES ('5', null, 'D', '案件管理', '1', '2012-03-25 12:06:50', '1', '2012-03-25 12:06:52');
INSERT INTO `acc_permission` VALUES ('6', '5', 'C', '新增案件', '1', '2012-03-25 12:07:19', '1', '2012-03-25 12:07:22');
INSERT INTO `acc_permission` VALUES ('7', '5', 'C', '修改案件', '1', '2012-03-25 12:07:57', '1', '2012-03-25 12:07:59');

-- ----------------------------
-- Table structure for `acc_role`
-- ----------------------------
DROP TABLE IF EXISTS `acc_role`;
CREATE TABLE `acc_role` (
  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `NAME` varchar(20) NOT NULL,
  `ENABLE` varchar(1) DEFAULT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of acc_role
-- ----------------------------
INSERT INTO `acc_role` VALUES ('1', '助理', '1', '1', '2012-04-26 00:00:00', '1', '2012-04-26 00:00:00');
INSERT INTO `acc_role` VALUES ('2', '秘书', '1', '1', '2012-03-25 00:00:00', '1', '2012-03-25 00:00:00');
INSERT INTO `acc_role` VALUES ('3', '律师', '1', '1', '2012-04-25 00:00:00', '1', '2012-04-25 00:00:00');
INSERT INTO `acc_role` VALUES ('4', '老总', '1', '1', '2012-04-25 00:00:00', '1', '2012-04-25 00:00:00');

-- ----------------------------
-- Table structure for `acc_role_permission`
-- ----------------------------
DROP TABLE IF EXISTS `acc_role_permission`;
CREATE TABLE `acc_role_permission` (
  `ID` bigint(20) NOT NULL,
  `ROLE_ID` bigint(20) NOT NULL,
  `PERMISSION_ID` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK960C817AE6A07929` (`ROLE_ID`),
  KEY `FK960C817A78956F49` (`PERMISSION_ID`),
  CONSTRAINT `FK960C817A78956F49` FOREIGN KEY (`PERMISSION_ID`) REFERENCES `acc_permission` (`ID`),
  CONSTRAINT `FK960C817AE6A07929` FOREIGN KEY (`ROLE_ID`) REFERENCES `acc_role` (`ID`),
  CONSTRAINT `FK_ROLE_PERMISSION_PERMISSION` FOREIGN KEY (`PERMISSION_ID`) REFERENCES `acc_permission` (`ID`),
  CONSTRAINT `FK_ROLE_PERMISSION_ROLE_ID` FOREIGN KEY (`ROLE_ID`) REFERENCES `acc_role` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of acc_role_permission
-- ----------------------------
INSERT INTO `acc_role_permission` VALUES ('13', '2', '1');
INSERT INTO `acc_role_permission` VALUES ('14', '2', '2');
INSERT INTO `acc_role_permission` VALUES ('15', '2', '3');
INSERT INTO `acc_role_permission` VALUES ('16', '2', '4');
INSERT INTO `acc_role_permission` VALUES ('17', '2', '5');
INSERT INTO `acc_role_permission` VALUES ('18', '2', '6');
INSERT INTO `acc_role_permission` VALUES ('32', '4', '1');
INSERT INTO `acc_role_permission` VALUES ('33', '4', '2');
INSERT INTO `acc_role_permission` VALUES ('34', '4', '3');
INSERT INTO `acc_role_permission` VALUES ('35', '4', '4');
INSERT INTO `acc_role_permission` VALUES ('36', '1', '1');
INSERT INTO `acc_role_permission` VALUES ('37', '1', '2');
INSERT INTO `acc_role_permission` VALUES ('38', '1', '3');
INSERT INTO `acc_role_permission` VALUES ('39', '1', '4');
INSERT INTO `acc_role_permission` VALUES ('40', '1', '5');
INSERT INTO `acc_role_permission` VALUES ('41', '1', '6');
INSERT INTO `acc_role_permission` VALUES ('42', '1', '7');

-- ----------------------------
-- Table structure for `acc_user`
-- ----------------------------
DROP TABLE IF EXISTS `acc_user`;
CREATE TABLE `acc_user` (
  `ID` bigint(20) NOT NULL,
  `ACCOUNT` varchar(20) NOT NULL,
  `ENABLE` varchar(1) NOT NULL,
  `EMAIL` varchar(20) NOT NULL,
  `MOBILE` varchar(20) NOT NULL,
  `PASSWORD` varchar(20) NOT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  `NAME` varchar(100) DEFAULT NULL,
  `LAST_LOGIN_TIME` datetime DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of acc_user
-- ----------------------------
INSERT INTO `acc_user` VALUES ('1', 'wangyijun', '1', '1@163.com', '1', 'abc123', '1', '2012-04-25 00:00:00', '1', '2012-04-25 00:00:00', '王一军', '2012-05-02 18:54:44');
INSERT INTO `acc_user` VALUES ('2', 'wujunfeng', '1', '1@1111.com', '1', '1', '1', '2012-05-09 00:00:00', '1', '2012-05-09 00:00:00', '吴俊峰', '2012-05-02 18:54:42');

-- ----------------------------
-- Table structure for `acc_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `acc_user_role`;
CREATE TABLE `acc_user_role` (
  `ID` bigint(20) NOT NULL,
  `ROLE_ID` bigint(20) NOT NULL,
  `USER_ID` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `FKA9467A2CE6A07929` (`ROLE_ID`),
  KEY `FKA9467A2C8BCB3D09` (`USER_ID`),
  CONSTRAINT `FKA9467A2C8BCB3D09` FOREIGN KEY (`USER_ID`) REFERENCES `acc_user` (`ID`),
  CONSTRAINT `FKA9467A2CE6A07929` FOREIGN KEY (`ROLE_ID`) REFERENCES `acc_role` (`ID`),
  CONSTRAINT `FK_USER_ROLE_ROLE_ID` FOREIGN KEY (`ROLE_ID`) REFERENCES `acc_role` (`ID`),
  CONSTRAINT `FK_USER_ROLE_USER_ID` FOREIGN KEY (`USER_ID`) REFERENCES `acc_user` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of acc_user_role
-- ----------------------------
INSERT INTO `acc_user_role` VALUES ('1', '1', '1');
INSERT INTO `acc_user_role` VALUES ('2', '1', '2');

-- ----------------------------
-- Table structure for `bl_bill`
-- ----------------------------
DROP TABLE IF EXISTS `bl_bill`;
CREATE TABLE `bl_bill` (
  `ID` int(11) NOT NULL,
  `CODE` varchar(200) DEFAULT NULL,
  `CREATE_BY` int(11) NOT NULL,
  `AMOUNT` double(11,2) DEFAULT NULL,
  `TASK_ID` int(11) DEFAULT NULL,
  `STATUS` varchar(10) DEFAULT NULL,
  `CURRENCY` varchar(10) NOT NULL,
  `DEADLINE` timestamp NULL DEFAULT NULL,
  `CREATE_TIME` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `LAST_UPDATE_BY` int(11) NOT NULL,
  `LAST_UPDATE_TIME` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `DESCRIPTION` varchar(800) DEFAULT NULL,
  `CHARGEOFF_TIME` datetime DEFAULT NULL,
  `PAID_TIME` datetime DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of bl_bill
-- ----------------------------
INSERT INTO `bl_bill` VALUES ('1', 'apple_1204283950', '1', '3020.00', '1', 'PAID', 'USD', '2012-05-12 00:00:00', '2012-04-28 11:43:04', '1', '2012-04-28 11:43:04', '餐旅费', '2012-05-02 19:13:13', '2012-05-02 19:13:51');
INSERT INTO `bl_bill` VALUES ('2', 'apple_1204284012', '1', '0.00', '1', 'NEW', 'USD', '2012-05-12 00:00:00', '2012-04-28 11:40:12', '1', '2012-04-28 11:40:12', '申请费', null, null);
INSERT INTO `bl_bill` VALUES ('3', 'apple_1204283529', '1', '1549.21', '1', 'PAID', 'USD', '2012-05-30 00:00:00', '2012-04-28 23:35:29', '1', '2012-04-28 23:35:29', '通讯费', '2012-04-29 00:47:51', '2012-05-02 18:54:30');

-- ----------------------------
-- Table structure for `bl_bill_detail`
-- ----------------------------
DROP TABLE IF EXISTS `bl_bill_detail`;
CREATE TABLE `bl_bill_detail` (
  `id` bigint(20) NOT NULL,
  `amount` double(11,2) DEFAULT NULL,
  `BILL_ID` bigint(20) DEFAULT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `DESCRIPTION` longtext,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of bl_bill_detail
-- ----------------------------
INSERT INTO `bl_bill_detail` VALUES ('1', '10000.99', '2', '1', '2012-04-28 11:41:22', '后面9毛9用来恶心人', '1', '2012-04-28 11:41:22');
INSERT INTO `bl_bill_detail` VALUES ('3', '20.00', '1', '1', '2012-04-28 11:42:56', '打车费', '1', '2012-04-28 11:42:56');
INSERT INTO `bl_bill_detail` VALUES ('4', '300.00', '3', '1', '2012-04-28 23:36:10', '手机费', '1', '2012-04-28 23:36:10');
INSERT INTO `bl_bill_detail` VALUES ('5', '150.11', '3', '1', '2012-04-28 23:36:33', '电话费', '1', '2012-04-28 23:36:33');
INSERT INTO `bl_bill_detail` VALUES ('6', '99.10', '3', '1', '2012-04-28 23:36:55', '传真费', '1', '2012-04-28 23:36:55');
INSERT INTO `bl_bill_detail` VALUES ('7', '1000.00', '3', '1', '2012-04-29 00:19:36', '视频服务费', '1', '2012-04-29 00:19:36');
INSERT INTO `bl_bill_detail` VALUES ('8', '2000.00', '1', '1', '2012-04-29 00:27:11', '酒店费', '1', '2012-04-29 00:27:11');
INSERT INTO `bl_bill_detail` VALUES ('9', '1000.00', '1', '1', '2012-04-29 00:28:48', '机票费', '1', '2012-04-29 00:28:48');
INSERT INTO `bl_bill_detail` VALUES ('11', '123.00', '2', '1', '2012-04-29 00:38:07', '1232', '1', '2012-04-29 00:38:07');

-- ----------------------------
-- Table structure for `bl_fee`
-- ----------------------------
DROP TABLE IF EXISTS `bl_fee`;
CREATE TABLE `bl_fee` (
  `ID` int(11) NOT NULL,
  `BILL_ID` int(11) DEFAULT NULL,
  `AMOUNT` double(11,2) NOT NULL,
  `DESCRIPTION` varchar(800) DEFAULT NULL,
  `STATUS` varchar(1) DEFAULT NULL,
  `CREATE_BY` int(11) DEFAULT NULL,
  `CREATE_TIME` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `LAST_UPDATE_BY` int(11) NOT NULL,
  `LAST_UPDATE_TIME` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `CODE` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`),
  KEY `FK_BL_FEE_BILL_FEE_BL_BILL` (`BILL_ID`),
  CONSTRAINT `FK_BL_FEE_BILL_FEE_BL_BILL` FOREIGN KEY (`BILL_ID`) REFERENCES `bl_bill` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of bl_fee
-- ----------------------------
INSERT INTO `bl_fee` VALUES ('1', '3', '1000.00', '招商汇款', null, '1', '2012-04-29 00:47:11', '1', '2012-04-29 00:47:11', 'ZS002');
INSERT INTO `bl_fee` VALUES ('2', '3', '549.21', '招商转账', null, '1', '2012-04-29 00:47:40', '1', '2012-04-29 00:47:40', 'ZS001');
INSERT INTO `bl_fee` VALUES ('3', '1', '3020.00', '付款', null, '1', '2012-05-02 19:13:46', '1', '2012-05-02 19:13:46', 'ZH_931');

-- ----------------------------
-- Table structure for `bs_category`
-- ----------------------------
DROP TABLE IF EXISTS `bs_category`;
CREATE TABLE `bs_category` (
  `ID` bigint(20) NOT NULL,
  `PARENT` bigint(20) DEFAULT NULL,
  `CODE` varchar(200) DEFAULT NULL,
  `CN_NAME` varchar(200) NOT NULL,
  `EN_NAME` varchar(200) DEFAULT NULL,
  `DESCRIPTION` varchar(800) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of bs_category
-- ----------------------------
INSERT INTO `bs_category` VALUES ('10', null, '11', '第十一类', '11th category', '照明、加温、蒸汽、烹调、冷藏、干燥、通风、供水以及卫生设备装置');
INSERT INTO `bs_category` VALUES ('11', '10', '1101', '照明用设备、器具（不包括汽灯，油灯）', '照明用设备、器具（不包括汽灯，油灯）', '关于第11类的描述，我希望它长一点，再长长长长长长长长长长长长长长长长长长长长长长……');
INSERT INTO `bs_category` VALUES ('12', '10', '1102', '喷焊灯 ', '', '');
INSERT INTO `bs_category` VALUES ('13', '11', '110007', '空中运载工具用照明设备', '', '');
INSERT INTO `bs_category` VALUES ('14', '11', '110020', '照明器', 'illuminator', '照明器');
INSERT INTO `bs_category` VALUES ('15', '11', '110021', '灯泡', 'lamp bulb', '就是个灯泡');
INSERT INTO `bs_category` VALUES ('16', '11', '110022', '电灯泡', 'electric light bulb', '');

-- ----------------------------
-- Table structure for `ct_company`
-- ----------------------------
DROP TABLE IF EXISTS `ct_company`;
CREATE TABLE `ct_company` (
  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `CODE` varchar(200) DEFAULT NULL,
  `NAME` varchar(200) NOT NULL,
  `TYPE` varchar(1) DEFAULT NULL,
  `ADDRESS` varchar(200) DEFAULT NULL,
  `TEL` varchar(200) DEFAULT NULL,
  `FAX` varchar(200) DEFAULT NULL,
  `WEBSITE` varchar(200) DEFAULT NULL,
  `DESCRIPTION` varchar(800) DEFAULT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of ct_company
-- ----------------------------
INSERT INTO `ct_company` VALUES ('1', 'samsumg', '三星集团', '1', null, '23456981', '23456981', 'www.samsumg.com', null, '1', '2011-12-07 04:05:22', '2011-12-07 04:05:22', '1');
INSERT INTO `ct_company` VALUES ('2', 'huawei', '华为集团', '1', null, '021-133321312', '021-1333232112', 'www.huawei.com', null, '1', '2012-01-07 19:24:40', '2012-04-28 00:00:00', '1');
INSERT INTO `ct_company` VALUES ('3', 'apple', '苹果集团', '1', null, '123459691', '123213232', 'www.apple.org', null, '1', '2012-04-28 00:00:00', '2012-04-28 00:00:00', '1');

-- ----------------------------
-- Table structure for `ct_contactor`
-- ----------------------------
DROP TABLE IF EXISTS `ct_contactor`;
CREATE TABLE `ct_contactor` (
  `ID` bigint(20) NOT NULL,
  `COMP_ID` bigint(20) DEFAULT NULL,
  `NAME` varchar(200) DEFAULT NULL,
  `JOBTITLE` varchar(200) DEFAULT NULL,
  `ISDEFAULT` varchar(1) DEFAULT NULL,
  `ADDRESS` varchar(200) DEFAULT NULL,
  `TEL` varchar(200) DEFAULT NULL,
  `MOBILE` varchar(200) DEFAULT NULL,
  `FAX` varchar(200) DEFAULT NULL,
  `EMAIL` varchar(200) DEFAULT NULL,
  `STANDBY_MOBILE` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`),
  KEY `FK1397B588235EA5` (`COMP_ID`),
  CONSTRAINT `FK1397B588235EA5` FOREIGN KEY (`COMP_ID`) REFERENCES `ct_company` (`ID`),
  CONSTRAINT `FK_CONTACTOR_COMPANY` FOREIGN KEY (`COMP_ID`) REFERENCES `ct_company` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of ct_contactor
-- ----------------------------
INSERT INTO `ct_contactor` VALUES ('1', '1', '金大中', '董事长', 'Y', '广州市天河北路311号', '3555555', '135000000', '88888', 'jdz@163.com', '1350000002');
INSERT INTO `ct_contactor` VALUES ('2', '2', '任正非', '董事长', 'Y', '深圳龙岗区某栋楼', '021-1312312312', '1362132188', '54564', 'rzf@huawei.com', '1362132188');
INSERT INTO `ct_contactor` VALUES ('3', '1', '李大中', '总经理', 'N', '', '123123', '123123', '', '', null);
INSERT INTO `ct_contactor` VALUES ('5', '1', '金顶顶顶', '部门经理', 'N', '123123', '132312', '312312', '312312', '3123123', '');
INSERT INTO `ct_contactor` VALUES ('7', '1', '金二巴', '首席信息官', 'N', '2312312', '12312', '12312', '13123123221', '32131231', '');
INSERT INTO `ct_contactor` VALUES ('8', '1', '棒棒棒亲戚', '123', 'N', '12312', '12312312', '3123', '3123', '12312', '131');
INSERT INTO `ct_contactor` VALUES ('9', '2', '任歪非', '副总', 'N', '在正非楼下', '021-3123555', '1339999999', '021-331443', 'rwf@huawei.com', '1338888888');
INSERT INTO `ct_contactor` VALUES ('10', '3', '乔布斯', '董事长', 'Y', '天堂', '123999494', '188888888', '993332113', 'jobs@apple.com', '199999999');
INSERT INTO `ct_contactor` VALUES ('11', '3', '杰克.斯洛伐克', '总裁秘书', 'N', '美国加利福尼亚州的旧金山经圣克拉拉', '021-35412312', '190000000', '123123', '12312', '190000001');

-- ----------------------------
-- Table structure for `fi_file`
-- ----------------------------
DROP TABLE IF EXISTS `fi_file`;
CREATE TABLE `fi_file` (
  `ID` bigint(20) NOT NULL,
  `DESCRIPTION` longtext,
  `NAME` longtext,
  `PARENT` bigint(20) DEFAULT NULL,
  `TASK_ID` bigint(20) DEFAULT NULL,
  `TYPE` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`),
  KEY `FKCC532378B8F8AAAA` (`PARENT`),
  CONSTRAINT `FKCC532378B8F8AAAA` FOREIGN KEY (`PARENT`) REFERENCES `fi_file` (`ID`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of fi_file
-- ----------------------------
INSERT INTO `fi_file` VALUES ('1', 'root', '目录', null, null, 'FILE');
INSERT INTO `fi_file` VALUES ('2', '第一档案室', '第一档案室', '1', null, 'FILE');
INSERT INTO `fi_file` VALUES ('5', '档案柜1-1', '档案柜1-1', '2', null, 'FILE');
INSERT INTO `fi_file` VALUES ('6', '档案柜1-2', '档案柜1-2', '2', null, 'FILE');
INSERT INTO `fi_file` VALUES ('7', '档案柜1-3', '档案柜1-3', '2', null, 'FILE');
INSERT INTO `fi_file` VALUES ('12', '123', '3123', '6', '8', 'DOCUMENT');
INSERT INTO `fi_file` VALUES ('17', '文件夹1-1-1', '文件夹1-1-1', '5', null, 'FILE');
INSERT INTO `fi_file` VALUES ('18', 'ipad申请商标图片', 'ipad申请商标图片', '20', '1', 'PICTURE');
INSERT INTO `fi_file` VALUES ('19', 'ipad申请商标文档', 'ipad申请商标文档', '20', '1', 'DOCUMENT');
INSERT INTO `fi_file` VALUES ('20', 'apple集团专属文件夹，所属律师王一军', 'apple集团文件夹', '17', null, 'FILE');
INSERT INTO `fi_file` VALUES ('21', '第二档案室', '第二档案室', '1', null, 'FILE');
INSERT INTO `fi_file` VALUES ('22', '文件柜2-1', '文件柜2-1', '21', null, 'FILE');

-- ----------------------------
-- Table structure for `no_notice`
-- ----------------------------
DROP TABLE IF EXISTS `no_notice`;
CREATE TABLE `no_notice` (
  `ID` bigint(20) NOT NULL,
  `TASK_ID` bigint(20) DEFAULT NULL,
  `STATUS` varchar(10) NOT NULL,
  `EXECUTE_TIME` datetime NOT NULL,
  `TITLE` varchar(200) NOT NULL,
  `CONTENT` varchar(2000) NOT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of no_notice
-- ----------------------------
INSERT INTO `no_notice` VALUES ('1', '1', 'RTS', '2012-06-14 08:00:00', '与苹果公司洽谈商标申请事宜', '与苹果公司洽谈商标申请事宜', '1', '2012-06-07 23:44:35', '2012-06-07 23:44:35', '1');
INSERT INTO `no_notice` VALUES ('2', null, 'RTS', '2012-06-25 08:00:00', '开会提醒', '6月25日下午一点一号会议室开会', '1', '2012-06-07 23:55:20', '2012-06-07 23:55:20', '1');
INSERT INTO `no_notice` VALUES ('3', null, 'SENT', '2012-06-07 08:00:00', '电话会议通知', '5月29日，下午3点电话会议', '1', '2012-06-07 23:57:13', '2012-06-07 23:57:13', '1');

-- ----------------------------
-- Table structure for `no_receive_mail`
-- ----------------------------
DROP TABLE IF EXISTS `no_receive_mail`;
CREATE TABLE `no_receive_mail` (
  `ID` bigint(20) NOT NULL,
  `NOTICE_ID` bigint(20) DEFAULT NULL,
  `STATUS` varchar(10) NOT NULL,
  `VALUE` varchar(100) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`) USING BTREE,
  KEY `notice_id` (`NOTICE_ID`),
  CONSTRAINT `notice_id` FOREIGN KEY (`NOTICE_ID`) REFERENCES `no_notice` (`ID`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of no_receive_mail
-- ----------------------------
INSERT INTO `no_receive_mail` VALUES ('1', '1', 'NEW', 'jobs@apple.com');
INSERT INTO `no_receive_mail` VALUES ('2', '3', 'NEW', 'xmufeng001@gmail.com');

-- ----------------------------
-- Table structure for `no_receive_message`
-- ----------------------------
DROP TABLE IF EXISTS `no_receive_message`;
CREATE TABLE `no_receive_message` (
  `ID` bigint(20) NOT NULL,
  `NOTICE_ID` bigint(20) DEFAULT NULL,
  `STATUS` varchar(10) NOT NULL,
  `VALUE` varchar(100) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`) USING BTREE,
  KEY `notice_id` (`NOTICE_ID`),
  CONSTRAINT `no_receive_message_ibfk_1` FOREIGN KEY (`NOTICE_ID`) REFERENCES `no_notice` (`ID`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of no_receive_message
-- ----------------------------
INSERT INTO `no_receive_message` VALUES ('1', '1', 'NEW', '13587144774');
INSERT INTO `no_receive_message` VALUES ('2', '1', 'NEW', '1557544678');
INSERT INTO `no_receive_message` VALUES ('3', '2', 'NEW', '1558777886');
INSERT INTO `no_receive_message` VALUES ('4', '2', 'NEW', '1574766777');
INSERT INTO `no_receive_message` VALUES ('5', '2', 'NEW', '1356778804');

-- ----------------------------
-- Table structure for `no_receive_system`
-- ----------------------------
DROP TABLE IF EXISTS `no_receive_system`;
CREATE TABLE `no_receive_system` (
  `ID` bigint(20) NOT NULL,
  `NOTICE_ID` bigint(20) DEFAULT NULL,
  `STATUS` varchar(10) NOT NULL,
  `VALUE` varchar(100) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`) USING BTREE,
  KEY `notice_id` (`NOTICE_ID`),
  CONSTRAINT `no_receive_system_ibfk_1` FOREIGN KEY (`NOTICE_ID`) REFERENCES `no_notice` (`ID`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of no_receive_system
-- ----------------------------

-- ----------------------------
-- Table structure for `tk_attachment`
-- ----------------------------
DROP TABLE IF EXISTS `tk_attachment`;
CREATE TABLE `tk_attachment` (
  `ID` bigint(20) NOT NULL,
  `TASK_ID` bigint(20) DEFAULT NULL,
  `PATH` varbinary(400) DEFAULT NULL,
  `DESCRIPTION` varchar(800) DEFAULT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`),
  KEY `FK1674BFEB3D9D7DE3` (`TASK_ID`),
  KEY `FK1674BFEBCDA15269` (`TASK_ID`),
  CONSTRAINT `FK1674BFEB3D9D7DE3` FOREIGN KEY (`TASK_ID`) REFERENCES `tk_task` (`ID`),
  CONSTRAINT `FK1674BFEBCDA15269` FOREIGN KEY (`TASK_ID`) REFERENCES `tk_task` (`ID`),
  CONSTRAINT `FK_ATTACHMENT_TASK` FOREIGN KEY (`TASK_ID`) REFERENCES `tk_task` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tk_attachment
-- ----------------------------

-- ----------------------------
-- Table structure for `tk_img`
-- ----------------------------
DROP TABLE IF EXISTS `tk_img`;
CREATE TABLE `tk_img` (
  `ID` bigint(20) NOT NULL,
  `TASK_ID` bigint(20) DEFAULT NULL,
  `PATH` varbinary(400) DEFAULT NULL,
  `DESCRIPTION` varchar(800) DEFAULT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`),
  KEY `FKCC02C1FB3D9D7DE3` (`TASK_ID`),
  KEY `FKCC02C1FBCDA15269` (`TASK_ID`),
  CONSTRAINT `FKCC02C1FB3D9D7DE3` FOREIGN KEY (`TASK_ID`) REFERENCES `tk_task` (`ID`),
  CONSTRAINT `FKCC02C1FBCDA15269` FOREIGN KEY (`TASK_ID`) REFERENCES `tk_task` (`ID`),
  CONSTRAINT `FK_IMG_TASK` FOREIGN KEY (`TASK_ID`) REFERENCES `tk_task` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tk_img
-- ----------------------------

-- ----------------------------
-- Table structure for `tk_task`
-- ----------------------------
DROP TABLE IF EXISTS `tk_task`;
CREATE TABLE `tk_task` (
  `ID` bigint(20) NOT NULL,
  `COMP_ID` bigint(20) DEFAULT NULL,
  `CN_NAME` varchar(200) NOT NULL,
  `EN_NAME` varchar(200) DEFAULT NULL,
  `CATEGORY_ID` bigint(20) DEFAULT NULL,
  `OWNER` bigint(20) DEFAULT NULL,
  `PRO_NAME` varchar(800) DEFAULT NULL,
  `DESCRIPTION` varchar(800) DEFAULT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  `STATUS` varchar(10) DEFAULT NULL,
  `TASK_NAME` longtext,
  `CODE` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `ID` (`ID`),
  KEY `FKB45A524D88235EA5` (`COMP_ID`),
  KEY `FKB45A524D99E6569D` (`CATEGORY_ID`),
  KEY `FKB45A524D9AE441AD` (`OWNER`),
  KEY `FKB45A524D9FB4A925` (`COMP_ID`),
  KEY `FKB45A524DA513E857` (`CATEGORY_ID`),
  CONSTRAINT `FKB45A524D88235EA5` FOREIGN KEY (`COMP_ID`) REFERENCES `ct_company` (`ID`),
  CONSTRAINT `FKB45A524D99E6569D` FOREIGN KEY (`CATEGORY_ID`) REFERENCES `bs_category` (`ID`),
  CONSTRAINT `FKB45A524D9AE441AD` FOREIGN KEY (`OWNER`) REFERENCES `acc_user` (`ID`),
  CONSTRAINT `FKB45A524D9FB4A925` FOREIGN KEY (`COMP_ID`) REFERENCES `ct_company` (`ID`),
  CONSTRAINT `FKB45A524DA513E857` FOREIGN KEY (`CATEGORY_ID`) REFERENCES `bs_category` (`ID`),
  CONSTRAINT `FK_TASK_CATEGORY` FOREIGN KEY (`CATEGORY_ID`) REFERENCES `bs_category` (`ID`),
  CONSTRAINT `FK_TASK_COMPANY` FOREIGN KEY (`COMP_ID`) REFERENCES `ct_company` (`ID`),
  CONSTRAINT `FK_USER_TASK_OWNER` FOREIGN KEY (`OWNER`) REFERENCES `acc_user` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tk_task
-- ----------------------------
INSERT INTO `tk_task` VALUES ('1', '3', '爱拍', 'ipad', '11', '1', null, 'ipad商标申请，平板电脑，小心叫唯冠的。', '1', '2012-04-28 11:35:52', '2012-05-24 02:36:59', '1', 'ACCEPT', 'ipad商标申请', null);
INSERT INTO `tk_task` VALUES ('2', '1', '盖世', 'galaxy', '11', '2', null, 'galaxy tab 申请', '1', '2012-05-26 19:03:34', '2012-05-26 19:08:08', '1', 'SRC', 'galaxy', null);
INSERT INTO `tk_task` VALUES ('3', '2', '华为云手机', 'huawei cloud mobile phone', null, '2', null, '华为云手机', '1', '2012-05-26 19:13:44', '2012-05-26 19:13:44', '1', 'APPLY', '华为云手机', null);

-- ----------------------------
-- Table structure for `tk_task_category`
-- ----------------------------
DROP TABLE IF EXISTS `tk_task_category`;
CREATE TABLE `tk_task_category` (
  `ID` bigint(20) NOT NULL,
  `CATEGORY_ID` bigint(20) NOT NULL,
  `TASK_ID` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tk_task_category
-- ----------------------------
INSERT INTO `tk_task_category` VALUES ('1', '14', '1');
INSERT INTO `tk_task_category` VALUES ('2', '16', '1');
INSERT INTO `tk_task_category` VALUES ('3', '15', '1');
INSERT INTO `tk_task_category` VALUES ('4', '14', '2');
INSERT INTO `tk_task_category` VALUES ('5', '16', '2');

-- ----------------------------
-- Table structure for `tk_task_contactor`
-- ----------------------------
DROP TABLE IF EXISTS `tk_task_contactor`;
CREATE TABLE `tk_task_contactor` (
  `ID` bigint(20) NOT NULL,
  `CONTACTOR_ID` bigint(20) NOT NULL,
  `TASK_ID` bigint(20) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`),
  KEY `FK24A53A91CDA15269` (`TASK_ID`),
  CONSTRAINT `FK24A53A91CDA15269` FOREIGN KEY (`TASK_ID`) REFERENCES `tk_task` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tk_task_contactor
-- ----------------------------
INSERT INTO `tk_task_contactor` VALUES ('1', '10', '1');
INSERT INTO `tk_task_contactor` VALUES ('2', '1', '2');
INSERT INTO `tk_task_contactor` VALUES ('3', '3', '2');

-- ----------------------------
-- Table structure for `tk_task_log`
-- ----------------------------
DROP TABLE IF EXISTS `tk_task_log`;
CREATE TABLE `tk_task_log` (
  `ID` bigint(20) NOT NULL,
  `CONTENT` varchar(255) NOT NULL,
  `CREATE_BY` bigint(20) NOT NULL,
  `CREATE_TIME` datetime NOT NULL,
  `IS_SYSTEM` varchar(10) NOT NULL,
  `LAST_UPDATE_BY` bigint(20) NOT NULL,
  `LAST_UPDATE_TIME` datetime NOT NULL,
  `TASK_ID` bigint(20) NOT NULL,
  `TITLE` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tk_task_log
-- ----------------------------
INSERT INTO `tk_task_log` VALUES ('1', '1111', '1', '2012-05-19 21:29:44', 'N', '1', '2012-05-19 21:29:50', '1', '111');
INSERT INTO `tk_task_log` VALUES ('3', '31231', '1', '2012-05-22 01:30:18', 'N', '1', '2012-05-22 01:30:18', '1', '12');
INSERT INTO `tk_task_log` VALUES ('4', '312312', '1', '2012-05-22 01:56:47', 'N', '1', '2012-05-22 01:56:47', '1', '2312');
INSERT INTO `tk_task_log` VALUES ('5', '31232123', '1', '2012-05-24 02:02:31', 'N', '1', '2012-05-24 02:43:02', '1', '12312333');
INSERT INTO `tk_task_log` VALUES ('8', '形式审查-->受理', '1', '2012-05-24 02:21:51', 'Y', '1', '2012-05-24 02:21:51', '1', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('9', '受理-->实质审查', '1', '2012-05-24 02:26:16', 'Y', '1', '2012-05-24 02:26:16', '1', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('10', '实质审查-->初步审查公告', '1', '2012-05-24 02:27:39', 'Y', '1', '2012-05-24 02:27:39', '1', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('11', '初步审查公告-->审核注册公告', '1', '2012-05-24 02:29:47', 'Y', '1', '2012-05-24 02:29:47', '1', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('12', '审核注册公告-->给予注册证', '1', '2012-05-24 02:29:57', 'Y', '1', '2012-05-24 02:29:57', '1', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('13', '形式审查-->补正', '1', '2012-05-24 02:32:33', 'Y', '1', '2012-05-24 02:32:33', '1', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('14', '补正-->受理', '1', '2012-05-24 02:36:59', 'Y', '1', '2012-05-24 02:36:59', '1', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('15', '今日接到金大中秘书金二中关于galaxy的商标申请传真。正式立案此商标案件', '1', '2012-05-26 19:05:24', 'N', '1', '2012-05-26 19:05:30', '2', '客户金大中递交申请');
INSERT INTO `tk_task_log` VALUES ('16', '商标申请-->形式审查', '1', '2012-05-26 19:05:42', 'Y', '1', '2012-05-26 19:05:42', '2', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('17', '由于资料不够全面，需要补正', '1', '2012-05-26 19:06:22', 'N', '1', '2012-05-26 19:06:22', '2', '需要补正');
INSERT INTO `tk_task_log` VALUES ('18', '形式审查-->补正', '1', '2012-05-26 19:06:29', 'Y', '1', '2012-05-26 19:06:29', '2', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('19', '补正-->受理', '1', '2012-05-26 19:06:41', 'Y', '1', '2012-05-26 19:06:41', '2', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('20', '受理-->实质审查', '1', '2012-05-26 19:06:46', 'Y', '1', '2012-05-26 19:06:46', '2', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('21', '实质审查-->初步审查公告', '1', '2012-05-26 19:06:49', 'Y', '1', '2012-05-26 19:06:49', '2', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('22', '国内厂家影驰提出审核异议，等待论证。', '1', '2012-05-26 19:07:57', 'N', '1', '2012-05-26 19:07:57', '2', 'galaxy商标审核异议');
INSERT INTO `tk_task_log` VALUES ('23', '初步审查公告-->审核注册公告', '1', '2012-05-26 19:08:04', 'Y', '1', '2012-05-26 19:08:04', '2', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('24', '审核注册公告-->给予注册证', '1', '2012-05-26 19:08:08', 'Y', '1', '2012-05-26 19:08:08', '2', '案件状态更新');
INSERT INTO `tk_task_log` VALUES ('25', '收到款项，结案', '1', '2012-05-26 19:08:35', 'N', '1', '2012-05-26 19:08:35', '2', '收到款项');

-- ----------------------------
-- Table structure for `tk_task_status`
-- ----------------------------
DROP TABLE IF EXISTS `tk_task_status`;
CREATE TABLE `tk_task_status` (
  `CODE` varchar(20) NOT NULL,
  `NAME` varchar(20) DEFAULT NULL,
  `NEXT_STEPS` varchar(200) DEFAULT NULL,
  `SEQUENCE` int(11) DEFAULT NULL,
  PRIMARY KEY (`CODE`),
  UNIQUE KEY `ID` (`CODE`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tk_task_status
-- ----------------------------
INSERT INTO `tk_task_status` VALUES ('ACCEPT', '受理', 'SE', '4');
INSERT INTO `tk_task_status` VALUES ('AE', '补正', 'ACCEPT,REJECT', '3');
INSERT INTO `tk_task_status` VALUES ('APPLY', '商标申请', 'FE', '1');
INSERT INTO `tk_task_status` VALUES ('ARA', '审核注册公告', 'SRC,REFUSE', '7');
INSERT INTO `tk_task_status` VALUES ('EO', '审核异议', 'ARA,REFUSE', '10');
INSERT INTO `tk_task_status` VALUES ('FE', '形式审查', 'ACCEPT,AE,REJECT', '2');
INSERT INTO `tk_task_status` VALUES ('PEA', '初步审查公告', 'ARA,EO', '6');
INSERT INTO `tk_task_status` VALUES ('REFUSE', '不予核准注册', null, '11');
INSERT INTO `tk_task_status` VALUES ('REJECT', '不予受理', null, '12');
INSERT INTO `tk_task_status` VALUES ('RR', '驳回申请', 'RE,REFUSE', '9');
INSERT INTO `tk_task_status` VALUES ('SE', '实质审查', 'PEA,RR', '5');
INSERT INTO `tk_task_status` VALUES ('SRC', '给予注册证', null, '8');

-- ----------------------------
-- Function structure for `get_file_path`
-- ----------------------------
DROP FUNCTION IF EXISTS `get_file_path`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `get_file_path`(`fileId` int) RETURNS varchar(1000) CHARSET utf8
    COMMENT 'sys_connect_by_path(name,">>") \r\n\r\n'
BEGIN
	  	DECLARE parentNodeId INT ;
	    DECLARE tempPath VARCHAR(1000);
SET parentNodeId=fileId; 
SET tempPath=''; 
#select name  ,sys_connect_by_path(name,">>") path from table1 start with id=? connect by prior child = parent; 
	WHILE parentNodeId is not NULL DO
	   SELECT fi_file.PARENT,if(tempPath = '',fi_file.NAME,CONCAT(fi_file.NAME,'>>',tempPath)) INTO parentNodeId, tempPath FROM fi_file fi_file where fi_file.ID=parentNodeId;
	END WHILE;
	RETURN tempPath;
END
;;
DELIMITER ;
